<div class="topics view">
<h2><?php echo $topic['Topic']['title']; ?></h2>
	<dl>
		<dt><?php echo __('Descripción'); ?></dt>
		<dd>
			<?php echo h($topic['Topic']['description']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Nivel'); ?></dt>
		<dd>
			<?php echo $this->Html->link($topic['Level']['title'], array('controller' => 'levels', 'action' => 'view', $topic['Level']['id'])); ?>
			&nbsp;
		</dd>
	</dl>

<div class="related">
	<h3><?php echo __('Preguntas del Tópico'); ?></h3>
	<?php if (!empty($topic['Question'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Pregunta'); ?></th>
		<th><?php echo __('Nivel Dificultad'); ?></th>
		<th class="actions"><?php echo __(''); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($topic['Question'] as $question): ?>
		<tr>
			<td><?php echo $this->Html->link($question['text'], array('controller' => 'questions', 'action' => 'view', $question['id'])); ?></td>
			<td><?php echo $question['level']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('Editar'), array('controller' => 'questions', 'action' => 'edit', $question['id'])); ?>
				<?php echo $this->Form->postLink(__('Eliminar'), array('controller' => 'questions', 'action' => 'delete_inContext', $question['id'], $question['topic_id']), null, __('¿Está seguro que desea eliminar la pregunta %s ?', $question['text'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li> 
			<?php echo  $this->Html->link(__('Nueva Pregunta', true), array('action' => 'add_question', $topic['Topic']['id']),true);?>			</li>
		</ul>
	</div>
</div>

</div>
<!--
<div class="actions">
	<h3><?php echo __('Acciones'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Editar Tópico'), array('action' => 'edit', $topic['Topic']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Eliminar Tópico'), array('action' => 'delete', $topic['Topic']['id']), null, __('¿Está seguro que desea eliminar el tópico %s?', $topic['Topic']['title'])); ?> </li>
		<li><?php echo $this->Html->link(__('* Listar Preguntas'), array('controller' => 'questions', 'action' => 'index')); ?> </li>

	</ul>
</div>
-->

